package com.bj58.mis.apm.server.statistics.dto.query;

import com.bj58.mis.apm.server.statistics.dto.DtoUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel(description = "查询列表的行数据")
public class QueryDataGridItem {
    @ApiModelProperty(value = "ID每页从1开始顺序增加")
    private String id;
    @ApiModelProperty(value = "项目名称")
    private String project;
    @ApiModelProperty(value = "项目标识")
    private String projectCode;
    @ApiModelProperty(value = "Cube名称")
    private String cube;
    //cube 英文名称
    private String cubeNameEn;
    @ApiModelProperty(value = "SQL内容")
    private String sql;
    @ApiModelProperty(value = "成功率")
    private double successRate;
    @ApiModelProperty(value = "查询次数")
    private int queryCount;

    @ApiModelProperty(value = "最慢响应时间.单位:秒")
    private double maxSlowQueryTime;

    @ApiModelProperty(value = "最慢响应时间是否超过阈值.0表示未超过阈值.1表示超过阈值")
    private int maxSlowQueryTimeAlert;

    @ApiModelProperty(value = "最后操作时间")
    private String lastOpTime;

    @ApiModelProperty(value = "平均耗时时间.单位秒")
    private float avgDuration;

    @ApiModelProperty(value = "CubeId和Sql的MD5值")
    private String md5;

    @ApiModelProperty(value = "Cube标识")
    public String getCubeCode() {
        return DtoUtil.getCubeCode(cubeNameEn);
    }
}
